//简单输出贴图颜色的像素着色器

//顶点着色器输出
struct VS_OUTPUT
{
    float4 Pos : SV_POSITION;
    float3 Normal : NORMAL;
	float2 TexCoord : TEXCOORD0;
};

cbuffer SceneData : register( b7 )
{
	matrix View;
	matrix Projection;
	float4 lightDir;
	float4 eyePosition;
}

float4 Main( VS_OUTPUT input ) : SV_Target
{
	//光线方向
	float3 LightDir = lightDir.xyz;
	
	//光线点乘法线
	float NdL = dot(normalize(input.Normal),normalize(LightDir));
	
	//将NdL限定在0到1
	NdL = saturate(NdL);
	
	//颜色系数
	float c = NdL * 0.7 + 0.3;

	return float4( c, c, c, 1.0 );
}
